Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall back from partial pull when on VFS #2140

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Oct 17, 2024

First refactor the logic a bit, to separate “are partial pulls allowed” from “set up partial pulls”.

See individual commits.

@giuseppe RFC on the logic, WRT composefs integrity enforcement.

Currently untested, that’s going to happen in containers/podman#24287 .

@mtrmac
Copy link
Collaborator Author

mtrmac commented Oct 17, 2024

Possibly fixes containers/podman#24308 .

mtrmac added a commit to mtrmac/libpod that referenced this pull request Oct 17, 2024
> go mod edit -replace github.com/containers/storage=github.com/mtrmac/storage@vfs-fallback

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@mtrmac
Copy link
Collaborator Author

mtrmac commented Oct 17, 2024

Confirming that this fixes the single reproducer in containers/podman#24308 .

@mtrmac mtrmac marked this pull request as ready for review October 18, 2024 00:17
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return nil, errors.New("both zstd:chunked and eStargz TOC found")
}

// convertImages also serves as a “must not fallback to non-partial pull” option (?!)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, for now at least it does. Because if that is set, we expect that every image is pulled using the partial pull code path, so that we can enforce composefs.

@rhatdan
Copy link
Member

rhatdan commented Oct 18, 2024

/lgtm

... to centralize the fallback allowed / required logic.

Should not change behavior, apart from maybe some error text.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Instead of sharing the badRequestErr logic, duplicate it.
That's a bit ugly, but we get better debug messages and a more
traditional control flow.

Should not change behavior, except for debug messages.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use switch to handle the various TOC presence cases

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... and other graph drivers which don't support partial pulls.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Oct 18, 2024
mtrmac added a commit to mtrmac/libpod that referenced this pull request Oct 18, 2024
> go mod edit -replace github.com/containers/storage=github.com/mtrmac/storage@vfs-fallback

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
mtrmac added a commit to mtrmac/libpod that referenced this pull request Oct 18, 2024
> go mod edit -replace github.com/containers/storage=github.com/mtrmac/storage@vfs-fallback

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
mtrmac added a commit to mtrmac/libpod that referenced this pull request Oct 18, 2024
> go mod edit -replace github.com/containers/storage=github.com/mtrmac/storage@vfs-fallback

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Merge at will.

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Contributor

openshift-ci bot commented Oct 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, mtrmac, vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [giuseppe,mtrmac,vrothberg]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit a42802e into containers:main Oct 21, 2024
20 checks passed
@mtrmac mtrmac deleted the vfs-fallback branch October 21, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants